
import 'package:demo/newsitem.dart';
import 'package:flutter/material.dart';

class NewsBox extends StatefulWidget {
  const NewsBox({Key? key}) : super(key: key);

  @override
  State<NewsBox> createState() => _NewsBoxState();
}

class _NewsBoxState extends State<NewsBox> {
  @override
  Widget build(BuildContext context) {
    return  Container(
       color:Colors.white,

       child:Column(
         crossAxisAlignment:CrossAxisAlignment.start,
         children: [
           Container(
             height:40,
             padding:const EdgeInsets.fromLTRB(15,0,15,0),
             child:Container(
               decoration:const BoxDecoration(
                   border:Border(
                       bottom:BorderSide(
                           width:0.5,
                           color:Color(0xEEEEEEEE),
                       )
                   )
               ),
               child: Row(
                 mainAxisAlignment:MainAxisAlignment.spaceBetween,
                 crossAxisAlignment:CrossAxisAlignment.center,
                 children: [
                   Wrap(
                     crossAxisAlignment:WrapCrossAlignment.center,
                     alignment:WrapAlignment.start,
                     children:const [
                       SizedBox(
                         width:14,
                         height:16,
                         child:Image(
                             image:AssetImage("images/icons/notice.png"),
                             fit:BoxFit.fill,
                         ),
                       ),
                       // Icon(Icons.newspaper_sharp,color:Colors.orange,),
                       SizedBox(width:5,),
                       Text("公告",style:TextStyle(
                          fontSize:14,
                          fontWeight:FontWeight.bold
                       ),)
                     ],
                   ),
                   Wrap(
                     crossAxisAlignment:WrapCrossAlignment.center,
                     alignment:WrapAlignment.center,
                     children:const [
                       Text("查看更多",style:TextStyle(
                          fontSize:12,
                          color:Colors.grey
                       )),
                       Align(
                         widthFactor:0.5,
                         alignment: Alignment(-0.5, 0),
                         child:Icon(Icons.chevron_right,
                           color:Colors.grey,
                         ),
                       )
                     ],
                   ),


                 ],
               ),
             ),
           ),
           Container(
              padding:EdgeInsets.fromLTRB(15, 0, 15, MediaQuery.of(context).padding.bottom),
              child:Column(
                 children: const [
                   NewsItem(),
                   NewsItem(),
                   NewsItem(),
                   NewsItem(),
                   NewsItem(),
                 ],
              ),
           )
         ],
       ),
    );
  }
}
